<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('出库审批')" />
    <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body>
<div class="main-content">
    <form class="form-horizontal" id="form-fEnter-edit" th:object="${fOutbound}">
        <input name="outId" th:field="*{outId}" type="hidden">
        <h4 class="form-header h4">基本信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">物品目录：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{thingName}"></p>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">物品名称：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{createName}"></p>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">出库类型：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{@dict.getLabel('f_outbound_type', outboundType)}"></p>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">数量：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{shuliang}"></p>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">人均消耗：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{pingjunSunhao}"></p>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="display: none" id="freasonDiv">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">超出平均单价理由：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{freason}"></p>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">备注：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{remark}"></p>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">出库人：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{createBy}"></p>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">出库时间：</label>
                    <div class="col-sm-8">
                        <p class="form-control-plaintext" th:text="*{#dates.format(outTime, 'yyyy-MM-dd')}"></p>
                    </div>
                </div>
            </div>
        </div>
        <h4 class="form-header h4">其他信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">审批状态：</label>
                    <div class="col-sm-8">
                        <div class="radio-box" th:each="dict : ${@dict.getType('f_shenpi')}">
                            <input type="radio" th:id="${'status_' + dict.dictCode}" name="examineStatus" th:value="${dict.dictValue}" th:checked="${dict.default}">
                            <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">审批意见：</label>
                    <div class="col-sm-8">
                        <textarea name="examineRemark" class="form-control">[[*{examineRemark}]]</textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="row" style="margin-bottom: 100px">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label"></label>
                    <button type="button" class="btn btn-w-m btn-primary" onclick="submitHandler()">提交</button>
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-fileinput-js"/>
<script th:inline="javascript">
    var fOutbound = [[${fOutbound}]]
    if(fOutbound.freason){
        $("#freasonDiv").css("display","block")
    }

    var prefix = ctx + "financial/fOutbound";

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/examineSave", $('#form-fEnter-edit').serialize());
        }
    }

</script>

</body>
</html>